/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package libs.Extends;

import java.awt.Color;
import java.awt.Component;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.border.MatteBorder;
import javax.swing.table.DefaultTableCellRenderer;

/**
 *
 * @author PHENOM II
 */
public class tableRenderer extends DefaultTableCellRenderer {

    private Color migrayClaro = new Color(225, 225, 225);
    private Color migrayOscuro = new Color(140, 140, 140);
    //private JLabel lbl;

    public tableRenderer() {
//        super();
//        lbl = new JLabel();
    }

    @Override
    public Component getTableCellRendererComponent(JTable table, Object value,
            boolean isSelected, boolean hasFocus, int row, int column) {
        this.setOpaque(true);
        this.setText(value.toString());
        this.setFont(new java.awt.Font("Tahoma", 0, 10));
        this.setForeground(Color.BLACK);
        if (row % 2 == 0) {
            this.setBackground(migrayClaro);
        } else {
            this.setBackground(Color.white);
        }

        super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
        if (!isSelected || !hasFocus) {
            this.setBorder(new MatteBorder(0, 0, 1, 1, new Color(89, 129, 153)));
        }
        this.setHorizontalAlignment(JLabel.CENTER);
        return this;
    }
}
